﻿namespace WatiN.Extensions.Tests
{
    using System.IO;

#if MSTest
    using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif
#if NUnit
    using NUnit.Framework;
#endif
#if Xunit
    using Xunit;
#endif

    using WatiN.Core;

#if MSTest
    [TestClass]
#endif

    public class ElementExtensionTests : WatiNTestBase
    {
#if MSTest
        private const string RootPath = "../../../";
#else
        private const string RootPath = "";
#endif

#if MSTest
        [TestMethod]
#endif
#if NUnit
        [Test]
#endif
#if Xunit
        [Fact]
#endif
        public void IsVisibleTest()
        {
            this.GoTo(GetPath("Site/Element.html"));

            var div1 = this.Get<Div>("div1");
            var div2 = this.Get<Div>("div2");
            var div3 = this.Get<Div>("div3");
            var div4 = this.Get<Div>("div4");

            div1.IsVisible(true);
            div2.IsVisible(true, false);
            div3.IsVisible(true, false);
            div4.IsVisible(true, false);
        }

        private static string GetPath(string filePath)
        {
            return Path.GetFullPath(string.Format("{0}{1}", RootPath, filePath));
        }
    }
}
